package com.wbao.dianniu.logical;

import com.wbao.dianniu.emojiUtils.SharedPreferencedUtils;

/**
 * Created by yejianjun on 2018/1/15.
 */

public class GlobalUserData {
    /**
     * 版本号 默认0
     */
    private static final String VERSIONCODE_PREFERENCES = "versionCode_preferences";
    /**
     * 简历是否完善 false：未完善，true：已完善
     */
    private final String ISPERFECTRESUME_PREFERENCES = "isPerfectResume_preferences";
    /**
     * 运行环境： qa：测式环境， prod： 正式环境，  local：本地环境
     */
    private final String ENVIRONMENT_PREFERENCES = "environment_preferences";
    // 我的积分 默认0
    private final String SCORE_PREFERENCES = "score_preferences";
    // 默认0
    private final String BEFRIEND_PREFERENCES = "beFriend_preferences";
    //默认0
    private final String DATAPRIVACY_PREFERENCES = "dataprivacy_preferences";

    private final String MOBILE_PREFERENCES = "mobile_preferences";
    /**
     * 简历显示或隐藏，0：隐藏，1：显示
     */
    private final String RESUMESTATUS_PREFERENCES = "resumestatus_preferences";


    public boolean getPerfectResume() {
        return SharedPreferencedUtils.getBoolean(DnApplication.getContext(), ISPERFECTRESUME_PREFERENCES, false);
    }

    public void setPerfectResume(boolean isPerfectResume) {
        SharedPreferencedUtils.setBoolean(DnApplication.getContext(), ISPERFECTRESUME_PREFERENCES, isPerfectResume);
    }

    public String getEnvironemt() {
        return SharedPreferencedUtils.getString(DnApplication.getContext(), ENVIRONMENT_PREFERENCES, "");
    }

    public void setEnvironment(String environment) {
        SharedPreferencedUtils.setString(DnApplication.getContext(), ENVIRONMENT_PREFERENCES, environment);
    }

    public int getScore() {
        return SharedPreferencedUtils.getInteger(DnApplication.getContext(), SCORE_PREFERENCES, 0);
    }

    public void setScore(int score) {
        SharedPreferencedUtils.setInteger(DnApplication.getContext(), SCORE_PREFERENCES, score);
    }

    public int getBeFriend() {
        return SharedPreferencedUtils.getInteger(DnApplication.getContext(), BEFRIEND_PREFERENCES, 0);
    }

    public void setBeFriend(int beFriend) {
        SharedPreferencedUtils.setInteger(DnApplication.getContext(), BEFRIEND_PREFERENCES, beFriend);
    }

    public int getDataprivacy() {
        return SharedPreferencedUtils.getInteger(DnApplication.getContext(), DATAPRIVACY_PREFERENCES, 0);
    }

    public void setDataprivacy(int dataprivacy) {
        SharedPreferencedUtils.setInteger(DnApplication.getContext(), DATAPRIVACY_PREFERENCES, dataprivacy);
    }

    public String getMobile() {
        return SharedPreferencedUtils.getString(DnApplication.getContext(), MOBILE_PREFERENCES, "");
    }

    public void setMobile(String mobile) {
        SharedPreferencedUtils.setString(DnApplication.getContext(), MOBILE_PREFERENCES, mobile);
    }

    /**
     * 简历显示或隐藏，0：隐藏，1：显示
     */
    public int getResumeStatus() {
        return SharedPreferencedUtils.getInteger(DnApplication.getContext(), RESUMESTATUS_PREFERENCES, 0);
    }

    /**
     * 简历显示或隐藏，0：隐藏，1：显示
     */
    public void setResumeStatus(Integer resumeStatus) {
        if (null == resumeStatus) {
            resumeStatus = 0;
        }
        SharedPreferencedUtils.setInteger(DnApplication.getContext(), RESUMESTATUS_PREFERENCES, resumeStatus);
    }

    public int getVersionCode() {
        return SharedPreferencedUtils.getInteger(DnApplication.getContext(), VERSIONCODE_PREFERENCES, 0);
    }

    public void setVersionCode(int versionCode) {
        SharedPreferencedUtils.setInteger(DnApplication.getContext(), VERSIONCODE_PREFERENCES, versionCode);
    }


}
